<div class="modal" style="display: block;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" ui-sref="^">
          <span aria-hidden="true">×</span></button>
        <h4 class="modal-title" ng-bind="eventTilte">添加日程</h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal" id="schedule_modal">
          <div class="form-group">
            <label class="col-sm-2 control-label">主题<span class="required">*</span></label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control" name="title" ng-model="schedule.title" data-rule="required; length[~120];">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">全天事件<span class="required">*</span></label>
            <div class="col-sm-7">
              <select ng-disabled="!schedule.editable" class="form-control select2" name="all_day" ng-model="schedule.all_day" data-rule="required;" style="width: 100%;">
                  <option value="0">否</option>
                  <option value="1">是</option>
                </select>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">性质<span class="required">*</span></label>
            <div class="col-sm-7">
              <select ng-disabled="!schedule.editable" class="form-control select2" name="property" ng-model="schedule.property" data-rule="required;" style="width: 100%;">
                  <option value="">请选择</option>
                  <option value="0">会议</option>
                  <option value="1">拜访客户</option>
                  <option value="2">其它</option>
                </select>
            </div>
          </div>
          <div class="form-group" ng-if="schedule.property == '0'">
            <label class="col-sm-2 control-label">会议类型<span class="required">*</span></label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control" name="meeting_type" ng-model="schedule.meeting_type" data-rule="required; length[1~20];">
            </div>
          </div>
          <div class="form-group" ng-if="schedule.property == '0'">
            <label class="col-sm-2 control-label">主持人<span class="required">*</span></label>
            <div class="col-sm-7">
              <select
                ng-disabled="!schedule.editable"
                class="form-control select2"
                id="presenter_id"
                name="presenter_id"
                ng-model="schedule.presenter_id"
                ng-options="item.id as item.name for item in memberList"
                data-rule="required;"
                style="width: 100%;"
              >
                <option value="">请选择</option>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">开始时间<span class="required">*</span></label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control date-input" name="schedule_start" ng-model="schedule.start" data-rule="required;">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">是否重复</label>
            <div class="col-sm-7 mt-5">
              <input ng-disabled="!schedule.editable" type="checkbox" name="is_repeat" ng-true-value="1" ng-model="schedule.is_repeat" id="isRepeat">
            </div>
          </div>

          <div class="form-group" ng-if="schedule.is_repeat">
            <label class="col-sm-2 control-label">重复类型<span class="required">*</span></label>
            <div class="col-sm-7">
              <select
                ng-disabled="!schedule.editable"
                class="form-control select2"
                name="repeat_type"
                ng-model="schedule.repeat_type"
                data-rule="required;"
                style="width: 100%;"
              >
                <option value="">请选择</option>
                <option value="1">每周</option>
                <option value="2">每月</option>
                <option value="3">每年</option>
              </select>
            </div>
          </div>

          <div class="form-group" ng-if="schedule.is_repeat && schedule.repeat_type == '1'">
            <label class="col-sm-2 control-label">重复<span class="required">*</span></label>
            <div class="col-sm-7 mt-5">
              <input ng-disabled="getRepeatWeekDisabled(0)" type="checkbox" name="repeat_w0" ng-change="repeatWeekChange(0, $event)" ng-true-value="0" ng-model="repeatWeek.repeat_w0" id="repeat_w0">
              <label for="repeat_w0" style="margin-right: 5px;">星期日</label>
              <input ng-disabled="getRepeatWeekDisabled(1)" type="checkbox" name="repeat_w1" ng-change="repeatWeekChange(1, $event)" ng-true-value="1" ng-model="repeatWeek.repeat_w1" id="repeat_w1">
              <label for="repeat_w1" style="margin-right: 5px;">星期一</label>
              <input ng-disabled="getRepeatWeekDisabled(2)" type="checkbox" name="repeat_w2" ng-change="repeatWeekChange(2, $event)" ng-true-value="2" ng-model="repeatWeek.repeat_w2" id="repeat_w2">
              <label for="repeat_w2" style="margin-right: 5px;">星期二</label>
              <input ng-disabled="getRepeatWeekDisabled(3)" type="checkbox" name="repeat_w3" ng-change="repeatWeekChange(3, $event)" ng-true-value="3" ng-model="repeatWeek.repeat_w3" id="repeat_w3">
              <label for="repeat_w3" style="margin-right: 5px;">星期三</label>
              <input ng-disabled="getRepeatWeekDisabled(4)" type="checkbox" name="repeat_w4" ng-change="repeatWeekChange(4, $event)" ng-true-value="4" ng-model="repeatWeek.repeat_w4" id="repeat_w4">
              <label for="repeat_w4" style="margin-right: 5px;">星期四</label>
              <input ng-disabled="getRepeatWeekDisabled(5)" type="checkbox" name="repeat_w5" ng-change="repeatWeekChange(5, $event)" ng-true-value="5" ng-model="repeatWeek.repeat_w5" id="repeat_w5">
              <label for="repeat_w5" style="margin-right: 5px;">星期五</label>
              <input ng-disabled="getRepeatWeekDisabled(6)" type="checkbox" name="repeat_w6" ng-change="repeatWeekChange(6, $event)" ng-true-value="6" ng-model="repeatWeek.repeat_w6" id="repeat_w6">
              <label for="repeat_w6">星期六</label>
            </div>
          </div>

          <div class="form-group" ng-if="schedule.all_day == 0 && !schedule.is_repeat">
            <label class="col-sm-2 control-label">结束时间</label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control date-input" name="schedule_end" ng-model="schedule.end">
            </div>
          </div>

          <div class="form-group" ng-show="schedule.is_repeat" id="repeatEnd">
            <label class="col-sm-2 control-label">重复截止至<span class="required">*</span></label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control" id="repeat_end" name="repeat_end" ng-model="schedule.repeat_end">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">地点</label>
            <div class="col-sm-7">
              <input ng-disabled="!schedule.editable" type="text" class="form-control" name="location" ng-model="schedule.location" data-rule="length[~120];">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">优先级<span class="required">*</span></label>
            <div class="col-sm-7">
              <select id="select2Color"  ng-disabled="!schedule.editable" class="form-control select2" name="color" ng-model="schedule.color" data-rule="required;" style="width: 100%;">
              </select>
              <span id="select2Color-validator" class="select-validator"></span>
            </div>
          </div>

          <div class="form-group" title="个人：仅自己可见，指定人员：指定人员可见，全公司：所有人可见">
            <label class="col-sm-2 control-label">权限范围<span class="required">*</span></label>
            <div class="col-sm-7">
              <select ng-disabled="!schedule.editable" class="form-control select2" name="type" ng-model="schedule.type" data-rule="required;" style="width: 100%;">
                  <option value="0">个人</option>
                  <option value="1">指定人员</option>
                  <option value="2">全公司</option>
                </select>
            </div>
          </div>

          <div class="form-group" ng-show="schedule.type == 1" id="rowpeople">
            <label class="col-sm-2 control-label">参与人员<span class="required">*</span></label>
            <div class="col-sm-7">
              <select ng-disabled="!schedule.editable" multiple class="form-control select2" id="joinPeople" name="joinPeople" style="width: 100%;">
              </select>
              <span id="peopleSelect2-validator" class="select-validator"></span>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">备注</label>
            <div class="col-sm-7">
              <textarea ng-disabled="!schedule.editable" class="form-control" rows="3" name="memo" ng-model="schedule.memo" data-rule=" length[~300];"></textarea>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer" ng-if="schedule.editable">
        <button type="button" class="btn btn-default pull-left" data-dismiss="modal" ui-sref="^">取消</button>
        <button type="button" class="btn btn-danger"  ng-if="schedule.id > 0" ng-click="delete()">删除</button>
        <button type="button" class="btn btn-primary" ng-click="save()">保存</button>
      </div>
    </div>
  </div>
</div>
